package com.company.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    int id;
    String name;
    String password;

    public User(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public static User fromMap(Map<String, Object> paramsMap) {
        User user = new User();
        user.setName((String) paramsMap.get("name"));
        user.setPassword((String) paramsMap.get("password"));
        return user;
    }
}
